package cn.lsp.sharkmall.mapper;

import cn.lsp.sharkmall.pojo.entity.ShoppingCartItem;
import cn.lsp.sharkmall.util.PageQueryUtil;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 购物车
 * @Author: sweeterjava@163.com
 * @Date: 2023/2/13
 * @Time: 01:26
 */
public interface ShoppingCartItemMapper {
    int deleteByPrimaryKey(Long cartItemId);

    int insert(ShoppingCartItem record);

    int insertSelective(ShoppingCartItem record);

    ShoppingCartItem selectByPrimaryKey(Long cartItemId);

    ShoppingCartItem selectByUserIdAndGoodsId(@Param("userId") Long userId,
                                              @Param("goodsId") Long goodsId);

    List<ShoppingCartItem> selectByUserId(@Param("userId") Long userId,
                                          @Param("number") int number);

    List<ShoppingCartItem> selectByUserIdAndCartItemIds(@Param("userId") Long newBeeMallUserId,
                                                        @Param("cartItemIds") List<Long> cartItemIds);

    int selectCountByUserId(Long userId);

    int updateByPrimaryKeySelective(ShoppingCartItem record);

    int updateByPrimaryKey(ShoppingCartItem record);

    int deleteBatch(List<Long> ids);

    List<ShoppingCartItem> findMyCartItems(PageQueryUtil pageUtil);

    int getTotalMyCartItems(PageQueryUtil pageUtil);
}
